<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Thanh Luan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <link rel="stylesheet" type="text/css" href="../scripts/tabs/slidingtabs-horizontal.css">
        <script type="text/javascript" src="../scripts/tabs/slidetab.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <link rel="stylesheet" type="text/css" href="../css/dropdown.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript">
            $j(document).ready(function() {
                $j('.text_search').live('keyup',function(){
                    if($j('.text_search').val() == ""){
                        $j('.noteRow').show();
                        $j('.close').trigger('click');   
                                   
                    }else{
                        $j('.close').trigger('click');   
                        $j('.noteRow').hide();
                        $j('.noteRow').each(function(){
                            html = $j(this).html();                            
                            if(ununicode(html).indexOf(ununicode($j('.text_search').val())) > -1)  {                                
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
                initThickBox('.thickbox');
                $j(".department2").live("click", function() {

                    fh200 = $j(".donvi").attr("lang");
                    fn850 = $j(this).attr("lang");
                    fn450 = $j(".department1").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    //   showPleaseWait(); 
                    $j.post("N450_N850.jsp?&action=group&fh200=" + fh200 + "&fn450=" + fn450 + "&fn850=" + fn850, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                            //       hidePleaseWait();        
                        }
                    });
                });
                $j('.loadproject').live('click', function() {
                    fis = $j(this).attr('lang');
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    showPleaseWait();
                    window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                });
                $j(".department3").live("click", function() {
                    fh200 = $j(".donvi").attr("lang");
                    fn850 = $j(this).attr("lang");
                    fn450 = $j(".department1").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    $j.post("N450_N850.jsp?&action=group&fh200=" + fh200 + "&fn450=" + fn450 + "&fn850=" + fn850, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                        }
                    });
                });
                $j(".cbx_editEmp").live("change", function() {
                    fn850 = $j(".department2").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    showPleaseWait();
                    $j.post("N450_N850.jsp?fn850=" + fn850 + "&emp=" + emp, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                            hidePleaseWait();
                        }
                    });
                });
                $j('.text_search').live('keyup', function() {
                    if ($j('.text_search').val() == "") {
                        $j('.noteRow').show();
                        $j('.close').trigger('click');

                    } else {
                        $j('.close').trigger('click');
                        $j('.noteRow').hide();
                        $j('.noteRow').each(function() {
                            html = $j(this).html();
                            if (ununicode(html).indexOf(ununicode($j('.text_search').val())) > -1) {
                                $j(this).show();
                            } else {
                                $j(this).hide();
                            }
                        });
                    }

                });
                $j('.icondots').live('hover', function() {
                    $j(this).next('.addgroup').css('display', 'block');
                    $j(this).next('.addgroup').css('z-index', '999');
                });
                $j('.icondots').live('mouseout', function() {
                    $j(this).next('.addgroup').css('display', 'none');
                });
                $j('.search_boxp').hide();
                $j('.sidebar_search').live('click', function() {
                    $j('.search_boxp').hide();
                    if ($j(this).next().hasClass('active')) {

                        $j('.search_boxp').removeClass('active');
                    } else {

                        $j('.search_boxp').removeClass('active');
                        $j(this).next().addClass('active');
                        $j(this).next().show();
                    }
                });
            });
        </script>

    </head>
    <body>
        <div id="content">
            <a4j:form>
                <div id="menutop_top">
                    <div class="div_search_menutop">
                        <div class="item_search">

                            <h:inputText onfocus="if(this.value=='search') this.value='';" style="float:left;" styleClass="text_search" value="#{customerExpand.keySearch}"/>
                            <div style="float:left;border-top: 1px solid #55ACDB;border-bottom: 1px solid #55ACDB;" class="img_search"> <h:graphicImage style="float:left;" value="../images1/arrow_down.png"/></div>
                            <div style="float:left;border: 1px solid #55ACDB;"> <h:graphicImage styleClass="find_all_emp" style="float:left;" value="../images1/btn_search.png"/></div>
                        </div>
                        <div class="form_search_header">
                            <div class="item_search "><h:outputText value="x" styleClass="close_search" style="font-weight:bold;float:right;margin-right:2.2%;"/></div>
                            <div class="item_search">
                                <table id="table_search">
                                    <tr>
                                        <td class="celltable">
                                            <h:selectOneRadio styleClass="css_radio" value="#{customerExpand.typesearch}">
                                                <f:selectItem itemValue="1" itemLabel="Công ty" />

                                                <f:selectItem itemValue="2" itemLabel="Phone" />
                                                <f:selectItem itemValue="3" itemLabel="Họ tên" />
                                                <f:selectItem itemValue="4" itemLabel="CMND/PP" />
                                                <f:selectItem itemValue="5" itemLabel="Email" />
                                                <f:selectItem itemValue="6" itemLabel="Tour" />
                                                <f:selectItem itemValue="7" itemLabel="MSKH" />
                                            </h:selectOneRadio>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td class="celltable">
                                            <h:commandButton      action="#{customerExpand.reload}" value="#{locale.search}" styleClass="buttonsearch">
                                            </h:commandButton>
                                        </td>

                                    </tr>
                                </table>

                            </div>
                        </div>
                    </div>
                    <%--
                    <div class="icon_action">
                        <h:panelGroup>

                            <h:selectOneMenu id="N1000" value="#{c150Controller.empId}" style="width:180px;height:26px;"  styleClass="cbx_editEmp">
                                <f:selectItems value="#{c150Controller.combN100Pro}" />
                            </h:selectOneMenu>
                        </h:panelGroup>
                    </div>
                    
                    <div class="icon_action">
                        <h:outputLink  value="managerSale.jsp?#{kapiMenu.md5url}">
                            <h:graphicImage title="SALE" value="../images/label_sale.png"/>
                        </h:outputLink>
                    </div>
                    <div class="icon_action">
                        <div class="classimageSMS">
                            <img src="../images/icon_list.png" class="sendSMS_person" lang="page=sendSMSitemEmployee"/>
                        </div>
                    </div>
                    <div class="icon_action">
                        <div class="classimageSMS">
                            <img src="../images/smsnew.png" class="sendSMS_person" lang="page=sendSMSitemEmployee" title="Xác nhận  SMS"/>
                        </div>
                    </div>
                    <div class="icon_action">
                        <div class="classimageSMS">
                            <img src="../images/searchnew.png" class="sendSMS_person" lang="page=sendSMSitemEmployee"/>
                        </div>
                    </div>   
                    <div class="icon_action">
                        <h:outputLink  value="editworkProject.jsp?action=addnew&page=project.jsp&height=5px&width=600px" styleClass="fancybox add_new" id="fancybox1">
                            <h:graphicImage title="Add công viêc" value="../images/icon_addTour.png"/>
                        </h:outputLink>
                    </div>
                    --%>
                </div>

                <div id="menutop">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#">
                                    <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                        <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                        <h:outputText rendered="#{n450_n850.fn850 ==0}" value="T?t c?"/>
                                    </span>
                                </a>

                            </div>
                            <div class="select_hidden departmentlistN850">

                                <ul>
                                    <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                                <h:outputText value="Tất cả"/>
                                            </span></a></li>                          


                                    <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                        <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                    <h:outputText value="#{item.label}"/>
                                                </span></a></li> 
                                            </a4j:repeat>
                                </ul>
                            </div>
                        </div>
                    </h:panelGroup>
                </div>
                <div style="width: 100%;overflow: auto;">
                    <div class="headerdivtable">
                        <div class="itemheaderdivtable_center" style="width: 3%;">
                            <h:outputText value="STT"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 5.9%;">
                            <h:outputText value="ACTION"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 19.95%;">
                            <h:outputText value="TÊN CÔNG VIỆC"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6.9%;">
                            <h:outputText value="DỰ ÁN"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 14.9%;">
                            <h:outputText value="NHÂN VIÊN"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 5.9%;">
                            <h:outputText value="NGÀY BẮT ĐẦU"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6.4%;">
                            <h:outputText value="NGÀY KẾT THÚC"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 4.95%;">
                            <h:outputText value="TRẠNG THÁI"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 15.8%;">
                            <h:outputText value="NGƯỜI YÊU CẦU"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 12.6%;">
                            <h:outputText value="GHI CHÚ"/>
                        </div>
                    </div>

                    <div class="headerdivtable_over" style="height: 60%;">
                        <a4j:repeat  value="#{c150Controller.lstC150}" var="item" rowKeyVar="index">    
                            <div class="noteRow headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                <div class="itemheaderdivtable_center " style="width: 3%;color:#0055A6;">
                                    <h:outputText value="#{index+1}"/>
                                </div>
                                <div class="itemheaderdivtable_center " style="width: 5.9%;color:#0055A6;">
                                    <div class="itemaction">
                                        <h:outputLink rendered="#{c150Controller.fis == 0 || c150Controller.fis == 2}"  value="editworkProject.jsp?action=edit&fis=#{c150Controller.fis}&FC150=#{item.pc150}&emp=#{c150Controller.empId}&FN600=#{item.fn600}&page=project.jsp&height=5px&width=600px" styleClass="fancybox add_new" id="fancybox1">
                                            <img src="../images/edit.png" alt="edit" title="edit"/>
                                        </h:outputLink>
                                        <h:outputLink rendered="#{c150Controller.fis != 0}"  value="editworkProject.jsp?action=edit&fis=#{c150Controller.fis}&FC150=#{item.pc150}&emp=#{c150Controller.empId}&FN600=#{item.fn600}&page=project.jsp&height=5px&width=600px" styleClass="fancybox add_new" id="fancyboxs">
                                            <img src="../images/edit.png" alt="edit" title="edit"/>
                                        </h:outputLink>
                                        <h:outputLink  value="delete.jsp?actionDel=deleteC150&fc150=#{item.pc150}&emp=#{c150Controller.empId}&flag=C150&width=300&height=150" styleClass="fancybox add_new" id="fancybox12">
                                            <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                        </h:outputLink>
                                        <h:outputLink  value="uploadfile.jsp?pc150=#{item.pc150}&page=project.jsp&type=ALL&table=C150&KeepThis=true&amp;TB_iframe=true&amp;height=350&amp;width=550&amp;modal=true" styleClass="thickbox add_new">
                                            <img  src="../images/docs_icon.png" height="20px" width="20px" title="Add document"/> 
                                        </h:outputLink>
                                        <h:outputLink  value="workReport.jsp?FC150=#{item.pc150}&FN600=#{item.fn600}&FC500=#{item.fc500}&action=edit&fis=#{c150Controller.fis}&emp=#{c150Controller.empId}&KeepThis=true&amp;TB_iframe=true&amp;height=453&amp;width=741&amp;modal=true" styleClass="thickbox add_new" >
                                            <img  src="../images/report.png" height="20px" width="20px" title="Add document"/> 
                                        </h:outputLink>
                                    </div>
                                </div>
                                <div class="itemheaderdivtable_left" style="width: 19.95%;color:#0055A6;">
                                    <h:outputText value="#{item.cv151}  (#{item.cv613})%"/>
                                </div>
                                <div class="itemheaderdivtable_left" style="width: 6.9%;color:#0055A6;">
                                    <h:outputText value="#{item.cv166}"/>
                                </div>
                                <div class="itemheaderdivtable_left" style="width: 14.9%;color:#0055A6;">
                                    <div style="float:left;width: 90%;"> 
                                        <h:outputText value="#{item.cv165}"/>
                                    </div>
                                    <div class="icondots" style="float:left;width: 10%;">
                                        <h:graphicImage value="../images/icon11.png"/>
                                        <div class="addgroup" style="display:<h:outputText rendered="#{item.lst ==null || item.lst == '' }" value="none"/>">                                                    
                                            <h:outputText value="#{item.lst}"  escape="false" />
                                        </div>
                                    </div>

                                </div>
                                <div class="itemheaderdivtable_center" style="width: 5.9%;color:#0055A6;">
                                    <h:outputText value="#{item.cd152}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 6.4%;color:#0055A6;">
                                        <div style="text-align: center;width: 100%;color: #A4211A;font-weight: bold;">
                                        <h:outputText value="#{item.cd153}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                        </div>
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 4.95%;color:#0055A6;">
                                        <div class="itemstatus" style="text-align: center;width: 100%;">
                                        <h:graphicImage rendered="#{item.fc450 == 2}" value="../images/priority_normal_large.png" height="35px" width="35px"/>
                                        <h:graphicImage rendered="#{item.fc450 == 1}" value="../images/priority_hight_large.png" height="35px" width="35px"/>
                                        <h:graphicImage rendered="#{item.fc450 == 3}" value="../images/priority_low_large.png" height="35px" width="35px"/>

                                        <h:graphicImage rendered="#{item.fc500 == 2}" alt="Running" value="../images/running_large.png" height="35px" width="35px"/>
                                        <h:graphicImage rendered="#{item.fc500 == 1}" alt="Open" value="../images/open_large.png" height="35px" width="35px"/>
                                        <h:graphicImage rendered="#{item.fc500 == 10}" alt="Finish" value="../images/finish_large.png" height="35px" width="35px"/>
                                    </div>
                                </div>
                                <div class="itemheaderdivtable_left" style="width: 15.8%;color:#0055A6;">
                                    <h:outputText value="#{item.cl199}"/>
                                </div>
                                <div class="itemheaderdivtable_left" style="width: 12.6%;color:#0055A6;">
                                    <div style="width:100%;" id="<h:outputText value="#{item.pc150}" />">
                                        <h:outputText value="#{item.subString}" id="item_mota"></h:outputText>
                                        <h:outputText rendered="#{item.lengthCB173 >200}" value="..." />
                                    </div>
                                </div>

                            </div>
                            <div class="showitemHistory">

                            </div>
                        </a4j:repeat>

                    </div>

                </div>
                <div class="fotter-page" style="float: right">
                    <jsp:include page="../../common/pagingM650.jsp"/>
                </div>
            </a4j:form>
        </div>

    </body>
</html>
